﻿<%@ Page Title="" Language="C#" MasterPageFile="~/UI/Admin/admin.Master" AutoEventWireup="true" CodeBehind="UserList.aspx.cs" Inherits="Paltop_v0._1.UI.Admin.UserList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  
    <p>
       
        Search:</p>
    <br />
    Email:
    <asp:TextBox ID="EmailTextBox" runat="server"></asp:TextBox> &nbsp;&nbsp;
    <asp:Button ID="SearchButton" runat="server" Text="Search" />
  
    <br />
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:PaltopDatabaseConnectionString %>" 
       

        
        SelectCommand="SELECT Email, Name, RegisterDate, AccountID FROM Account WHERE (Email LIKE '%' + @Email + '%') ORDER BY AccountID" 
        DeleteCommand="Insert into DeleteList values(@AccountID,getdate())">
        <DeleteParameters>
            <asp:Parameter Name="AccountID" />
        </DeleteParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="EmailTextBox" DefaultValue="_" Name="Email" 
                PropertyName="Text" />
        </SelectParameters>
       
    </asp:SqlDataSource>
    <br />
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="AccountID" 
        DataSourceID="SqlDataSource1" onrowdeleting="GridView1_RowDeleting">
        <Columns>
            <asp:CommandField ShowDeleteButton="True" />
            <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
            <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
            <asp:BoundField DataField="RegisterDate" HeaderText="RegisterDate" 
                SortExpression="RegisterDate" />
            <asp:BoundField DataField="AccountID" HeaderText="AccountID" 
                InsertVisible="False" ReadOnly="True" SortExpression="AccountID" />
        </Columns>
    </asp:GridView>
  
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
</asp:Content>
